# /Users/xing/agentic_jira/config.py
import os
from dotenv import load_dotenv

load_dotenv()

class Config:
    def __init__(self):
        # Database configuration
        self.db_type = os.getenv('DB_TYPE', 'elasticsearch')
        self.elasticsearch_url = os.getenv('ELASTICSEARCH_URL', 'http://localhost:9200')
        self.opensearch_url = os.getenv('OPENSEARCH_URL', 'http://localhost:9200')
        
        # Jira MCP configuration
        self.mcp_url = os.getenv('MCP_URL', 'http://localhost:8000')
        self.mcp_username = os.getenv('MCP_USERNAME', '')
        self.mcp_api_key = os.getenv('MCP_API_KEY', '')
        
        # LLM configuration
        self.llm_api_base = os.getenv('LLM_API_BASE', 'http://localhost:8000/v1')
        self.llm_api_key = os.getenv('LLM_API_KEY', 'your-api-key')
        self.llm_model = os.getenv('LLM_MODEL', 'gpt-3.5-turbo')
        
        # RAG configuration
        self.rag_enabled = os.getenv('RAG_ENABLED', 'true').lower() == 'true'
        self.knowledge_base_path = os.getenv('KNOWLEDGE_BASE_PATH', './data/knowledge_base')
        
        # Elasticsearch RAG configuration
        self.elasticsearch_host = os.getenv('ELASTICSEARCH_HOST', 'localhost:9200')
        self.elasticsearch_index = os.getenv('ELASTICSEARCH_INDEX', 'knowledge_base')
        self.embedding_model = os.getenv('EMBEDDING_MODEL', 'all-MiniLM-L6-v2')

config = Config()